<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGuestbookTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('guestbook', function (Blueprint $table) {
            $table->increments('id')->comment('自增ID');
            $table->unsignedInteger('member_id')->default('0')->comment('会员ID（备用）');
            $table->string('customer_name', 20)->default('')->comment('客户姓名');
            $table->string('customer_phone_number', 20)->default('')->comment('联系电话');
            $table->string('customer_email', 20)->default('')->comment('电子邮箱');
            $table->string('message', 300)->default('')->comment('留言内容');
            $table->string('remark', 300)->default('')->comment('管理员备注');
            $table->unsignedTinyInteger('status')->default('0')->comment('处理状态，0未处理，1已处理');
            $table->unsignedInteger('created_user_id')->default('0')->comment('管理员ID');
            $table->timestamp('created_at')->nullable()->comment('创建时间');
            $table->timestamp('updated_at')->nullable()->comment('更新时间');
            $table->softDeletes()->comment('删除时间');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('guestbook');
    }
}
